Skip to content

Conversation

@AustinMroz
Copy link
Collaborator

@AustinMroz AustinMroz commented Dec 4, 2025

Adds a frontend support for a "Custom Combo" node which contains a Combo Widget, and a growing list of string inputs that determine the options available to the combo.

Custom Combo

By promoting the combo widget on this node, a list of options determined by workflow builders can be exposed to end users.

CC: @Kosinkadink

┆Issue is synchronized with this Notion page by Unito

@AustinMroz AustinMroz requested a review from a team as a code owner December 4, 2025 00:51
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

📝 Walkthrough

Walkthrough

Adds a frontend LiteGraph extension implementing a CustomCombo node that manages dynamic string option widgets, wires a combo widget with custom getters/setters and auto-added options, and propagates the selected value along downstream links via an added applyToGraph flow. Registers the node in system definitions.

Changes

Cohort / File(s) Summary
CustomCombo Extension
src/extensions/core/customCombo.ts, src/extensions/core/index.ts
New frontend extension registered as Comfy.CustomCombo. Implements a CustomCombo LiteGraph behavior: creates a combo widget whose options come from dynamic option widgets, provides internal addOption logic, attaches custom getters/setters and a wrapped callback to trigger propagation, exposes applyToGraph(extraLinks: LLink[] = []) to propagate the chosen string to downstream node inputs, and hooks into node creation via beforeRegisterNodeDef. index.ts imports and loads this extension.
System Node Definitions
src/stores/nodeDefStore.ts
Adds CustomCombo to SYSTEM_NODE_DEFS with metadata (name/display_name, category utils, required inputs choice and option0, string output, experimental: true, and description).
sequenceDiagram
    autonumber
    participant User
    participant CustomCombo as Extension
    participant Graph
    participant DownNode as DownstreamNode
    participant Widget

    User->>CustomCombo: change combo selection / trigger widget callback
    CustomCombo->>Graph: applyToGraph(extraLinks?)
    Graph->>Graph: gather outgoing Links from combo node
    Graph->>DownNode: set input widget value (via link target)
    DownNode->>Widget: update widget.value (setter/getter)
    Widget->>DownNode: invoke original callback with synthetic CanvasPointerEvent
    DownNode-->>User: downstream node updated
Loading
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch austin/custom-combo

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9f2c4d and 0ca3b52.

📒 Files selected for processing (1)
  • src/extensions/core/customCombo.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/extensions/core/customCombo.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/extensions/core/customCombo.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/extensions/core/customCombo.ts
🧬 Code graph analysis (1)
src/extensions/core/customCombo.ts (3)
src/extensions/core/widgetInputs.ts (2)
  • applyToGraph (43-87)
  • input (353-366)
src/scripts/app.ts (1)
  • app (1708-1708)
src/composables/functional/useChainCallback.ts (1)
  • useChainCallback (24-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: collect
  • GitHub Check: lint-and-format
🔇 Additional comments (1)
src/extensions/core/customCombo.ts (1)

104-112: Extension registration pattern looks good

The beforeRegisterNodeDef hook and useChainCallback usage to compose onNodeCreated for CustomCombo is consistent with other extensions and keeps the behavior additive rather than replacing existing hooks. No issues here from a correctness standpoint.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 12/04/2025, 06:44:24 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 12/04/2025, 06:52:44 AM UTC

📈 Summary

  • Total Tests: 496
  • Passed: 484 ✅
  • Failed: 0
  • Flaky: 2 ⚠️
  • Skipped: 10 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 475 / ❌ 0 / ⚠️ 2 / ⏭️ 10
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Bundle Size Report

Summary

  • Raw size: 17 MB baseline 17 MB — 🔴 +3.4 kB
  • Gzip: 3.38 MB baseline 3.38 MB — 🔴 +863 B
  • Brotli: 2.59 MB baseline 2.59 MB — 🔴 +349 B
  • Bundles: 97 current • 97 baseline • 37 added / 37 removed

Category Glance
App Entry Points 🔴 +3.4 kB (3.2 MB) · Vendor & Third-Party ⚪ 0 B (8.56 MB) · Other ⚪ 0 B (3.81 MB) · Graph Workspace ⚪ 0 B (972 kB) · Panels & Settings ⚪ 0 B (298 kB) · UI Components ⚪ 0 B (173 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.2 MB (baseline 3.2 MB) • 🔴 +3.4 kB

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-Cn5FWl95.js (new) 2.97 MB 🔴 +2.97 MB 🔴 +619 kB 🔴 +471 kB
assets/index-B-QjqsJ2.js (removed) 2.97 MB 🟢 -2.97 MB 🟢 -619 kB 🟢 -471 kB
assets/index-N7xGuPM2.js (new) 226 kB 🔴 +226 kB 🔴 +48.4 kB 🔴 +39.7 kB
assets/index-Dtgewmbu.js (removed) 223 kB 🟢 -223 kB 🟢 -47.6 kB 🟢 -39.2 kB
assets/index-CfRbT_xa.js (new) 345 B 🔴 +345 B 🔴 +244 B 🔴 +235 B
assets/index-DUOz2Q2R.js (removed) 345 B 🟢 -345 B 🟢 -245 B 🟢 -234 B

Status: 3 added / 3 removed

Graph Workspace — 972 kB (baseline 972 kB) • ⚪ 0 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-_e0yG5VP.js (new) 972 kB 🔴 +972 kB 🔴 +188 kB 🔴 +143 kB
assets/GraphView-DU-N5-BE.js (removed) 972 kB 🟢 -972 kB 🟢 -188 kB 🟢 -143 kB

Status: 1 added / 1 removed

Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-0fuSrYlP.js (removed) 6.54 kB 🟢 -6.54 kB 🟢 -2.14 kB 🟢 -1.9 kB
assets/UserSelectView-Q3qlJ3dv.js (new) 6.54 kB 🔴 +6.54 kB 🔴 +2.14 kB 🔴 +1.91 kB

Status: 1 added / 1 removed

Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/CreditsPanel-CTwYT_VJ.js (new) 21.4 kB 🔴 +21.4 kB 🔴 +5.15 kB 🔴 +4.49 kB
assets/CreditsPanel-D5248SiH.js (removed) 21.4 kB 🟢 -21.4 kB 🟢 -5.15 kB 🟢 -4.49 kB
assets/KeybindingPanel-C_nFEeUa.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.01 kB
assets/KeybindingPanel-CC09zfcP.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.01 kB
assets/ExtensionPanel-_T-61V7x.js (new) 10.8 kB 🔴 +10.8 kB 🔴 +2.58 kB 🔴 +2.25 kB
assets/ExtensionPanel-COjkJfow.js (removed) 10.8 kB 🟢 -10.8 kB 🟢 -2.58 kB 🟢 -2.26 kB
assets/AboutPanel-C1LjDJ-y.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/AboutPanel-CocaXm1q.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-6P5uUukZ.js (new) 6.56 kB 🔴 +6.56 kB 🔴 +1.83 kB 🔴 +1.63 kB
assets/ServerConfigPanel-DtrgsEst.js (removed) 6.56 kB 🟢 -6.56 kB 🟢 -1.83 kB 🟢 -1.63 kB
assets/UserPanel-CB4B480K.js (new) 6.23 kB 🔴 +6.23 kB 🔴 +1.72 kB 🔴 +1.5 kB
assets/UserPanel-DihyjM6e.js (removed) 6.23 kB 🟢 -6.23 kB 🟢 -1.72 kB 🟢 -1.51 kB
assets/settings-BhbWhsRg.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BXTtSH4O.js 33.3 kB 33.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C9Pzn-NG.js 25.2 kB 25.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CCy2fA_h.js 27.3 kB 27.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CQpqEFfl.js 26.6 kB 26.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DHcnxypw.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DhFTK9fY.js 25.1 kB 25.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DlT4t_ui.js 25.9 kB 25.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DRgSrIdD.js 24.2 kB 24.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-tjkeqiZq.js 21.1 kB 21.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 173 kB (baseline 173 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/Load3D.vue_vue_type_script_setup_true_lang-7txeDSmP.js (new) 53.9 kB 🔴 +53.9 kB 🔴 +8.52 kB 🔴 +7.31 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-CSPWe6Vp.js (removed) 53.9 kB 🟢 -53.9 kB 🟢 -8.52 kB 🟢 -7.31 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-5H8pZdiU.js (new) 47.6 kB 🔴 +47.6 kB 🔴 +10.3 kB 🔴 +8.9 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BQnnuPS0.js (removed) 47.6 kB 🟢 -47.6 kB 🟢 -10.3 kB 🟢 -8.91 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-CPOY96Dh.js (removed) 43.3 kB 🟢 -43.3 kB 🟢 -9.68 kB 🟢 -8.47 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-DW-cVUxL.js (new) 43.3 kB 🔴 +43.3 kB 🔴 +9.68 kB 🔴 +8.45 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-BuiiYw-6.js (new) 12.9 kB 🔴 +12.9 kB 🔴 +3.37 kB 🔴 +2.97 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-D5LsDLgz.js (removed) 12.9 kB 🟢 -12.9 kB 🟢 -3.37 kB 🟢 -2.96 kB
assets/ComfyQueueButton-BMBy3iED.js (new) 8.44 kB 🔴 +8.44 kB 🔴 +2.47 kB 🔴 +2.21 kB
assets/ComfyQueueButton-Csm34ph8.js (removed) 8.44 kB 🟢 -8.44 kB 🟢 -2.47 kB 🟢 -2.21 kB
assets/MediaTitle.vue_vue_type_script_setup_true_lang-BAV4xT3b.js (removed) 897 B 🟢 -897 B 🟢 -503 B 🟢 -430 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-C49tfQtO.js (new) 897 B 🔴 +897 B 🔴 +502 B 🔴 +432 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-DRxvgpU7.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-DBkWxjh1.js 2.04 kB 2.04 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-VhqMWCTd.js 2.16 kB 2.16 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-C3XRY_H7.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.84 kB 🔴 +1.58 kB
assets/keybindingService-Cwi__K-u.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.58 kB
assets/audioService-B8KX-GDi.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -962 B 🟢 -825 B
assets/audioService-BxkbFnFf.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +960 B 🔴 +823 B
assets/serverConfigStore-BIb40oOr.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-BWU2kLod.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +652 B 🔴 +548 B
assets/audioUtils-CGJSTwbQ.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -651 B 🟢 -547 B
assets/mathUtil-CTARWQ-l.js 1.07 kB 1.07 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeFilterUtil-CXKCRJ-m.js 460 B 460 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 1 added / 1 removed

Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-DWRkrNy1.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-BZzgsWym.js 3.98 MB 3.98 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-3gHexYD_.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-aR6ntw5X.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-Dw558Ulu.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-CoO6TOrn.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BZLod3g9.js 407 kB 407 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.81 MB (baseline 3.81 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/WidgetRecordAudio-C2X_5Y3Z.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.24 kB 🟢 -4.63 kB
assets/WidgetRecordAudio-emFCFtP9.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.23 kB 🔴 +4.63 kB
assets/AudioPreviewPlayer-4mjw4Oav.js (removed) 13.5 kB 🟢 -13.5 kB 🟢 -3.4 kB 🟢 -3.04 kB
assets/AudioPreviewPlayer-DmzuDoqA.js (new) 13.5 kB 🔴 +13.5 kB 🔴 +3.4 kB 🔴 +3.04 kB
assets/WidgetGalleria-Cih0xIve.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.44 kB 🟢 -1.31 kB
assets/WidgetGalleria-DyXF9qgN.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.45 kB 🔴 +1.31 kB
assets/WidgetColorPicker-C1SYM1EM.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.22 kB
assets/WidgetColorPicker-DjNlDsVK.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.23 kB
assets/WidgetMarkdown-C70dBhXr.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.12 kB
assets/WidgetMarkdown-DOxSSl0b.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.12 kB
assets/WidgetAudioUI-DfJntt1T.js (removed) 2.82 kB 🟢 -2.82 kB 🟢 -1.12 kB 🟢 -1.02 kB
assets/WidgetAudioUI-k3MkBrW8.js (new) 2.82 kB 🔴 +2.82 kB 🔴 +1.12 kB 🔴 +1.02 kB
assets/WidgetTextarea-DltKDTZH.js (removed) 2.79 kB 🟢 -2.79 kB 🟢 -1.1 kB 🟢 -1 kB
assets/WidgetTextarea-M3WyVZX1.js (new) 2.79 kB 🔴 +2.79 kB 🔴 +1.09 kB 🔴 +1 kB
assets/WidgetInputText-BNwgN1q8.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +915 B 🔴 +845 B
assets/WidgetInputText-C841JFb_.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -918 B 🟢 -847 B
assets/MediaImageBottom-BreTdRot.js (new) 1.57 kB 🔴 +1.57 kB 🔴 +740 B 🔴 +646 B
assets/MediaImageBottom-Cun1KShn.js (removed) 1.57 kB 🟢 -1.57 kB 🟢 -743 B 🟢 -645 B
assets/MediaAudioBottom-D55rMFEw.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +740 B 🔴 +662 B
assets/MediaAudioBottom-DwPzl9UC.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -741 B 🟢 -658 B
assets/MediaVideoBottom--gs4jdOQ.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +739 B 🔴 +656 B
assets/MediaVideoBottom-BKmycZVZ.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -739 B 🟢 -656 B
assets/Media3DBottom-D5YJSgTJ.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -734 B 🟢 -650 B
assets/Media3DBottom-DJb_4ILo.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +731 B 🔴 +650 B
assets/Media3DTop-DlgOI0O6.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -765 B 🟢 -647 B
assets/Media3DTop-DUEDCXwc.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +765 B 🔴 +647 B
assets/WidgetSelect-BpxavyUq.js (new) 655 B 🔴 +655 B 🔴 +339 B 🔴 +288 B
assets/WidgetSelect-BRv3HPww.js (removed) 655 B 🟢 -655 B 🟢 -344 B 🟢 -289 B
assets/WidgetInputNumber-BBbcZ5gi.js (new) 595 B 🔴 +595 B 🔴 +326 B 🔴 +272 B
assets/WidgetInputNumber-BvI7XU9h.js (removed) 595 B 🟢 -595 B 🟢 -331 B 🟢 -274 B
assets/Load3D-CbNnngZk.js (new) 424 B 🔴 +424 B 🔴 +266 B 🔴 +225 B
assets/Load3D-CN6XN8SE.js (removed) 424 B 🟢 -424 B 🟢 -268 B 🟢 -225 B
assets/WidgetLegacy-CqpS2Ics.js (new) 364 B 🔴 +364 B 🔴 +237 B 🔴 +228 B
assets/WidgetLegacy-CsjB0JYz.js (removed) 364 B 🟢 -364 B 🟢 -237 B 🟢 -228 B
assets/commands-_s-RvhJR.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BuUILW6P.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BV4R6fLx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BWp4HdfU.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CLwPdnT6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CWMchBmd.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DazTQhtc.js 12.9 kB 12.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DmWrOe93.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwiH7Kr6.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-mS3LCNPn.js 14.5 kB 14.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-B1JflQcI.js 72.2 kB 72.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-B2lyXe48.js 114 kB 114 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-B9XEQ-pc.js 94 kB 94 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BErKFzc-.js 73.1 kB 73.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Bf7Tze-u.js 83.4 kB 83.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BhGMcO4Q.js 84.3 kB 84.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CPZUloNQ.js 99 kB 99 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cw9RZWRY.js 89 B 89 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Dva0z-T2.js 86.5 kB 86.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-un0K9wDS.js 81.8 kB 81.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DX0t5RN3.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-BN0aEMtg.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BpvqEylZ.js 2.76 kB 2.76 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-8e6QYQW0.js 283 kB 283 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-A_9dx4yn.js 304 kB 304 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BbD3HDi7.js 307 kB 307 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BOJhIPft.js 369 kB 369 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Bw_Jitw_.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-C-Pw33mW.js 317 kB 317 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-ChLyG0UJ.js 285 kB 285 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CUVPxA4l.js 342 kB 342 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Dx5Y4xrW.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-JqO5mNmW.js 306 kB 306 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-DsbKXC7D.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-nVNi67CU.js 2.21 kB 2.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetToggleSwitch-DkvdXJVp.js 1.58 kB 1.58 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 17 added / 17 removed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/extensions/core/customCombo.ts (2)

20-21: Consider adding a null check instead of non-null assertion.

The ! assertion at line 21 assumes addWidget always succeeds and at(-1) returns a value. While this should be true immediately after addWidget, a defensive check would be safer.

     this.addWidget('combo', 'choice', '', () => {}, options)
-    const comboWidget = this.widgets?.at(-1)!
+    const comboWidget = this.widgets?.at(-1)
+    if (!comboWidget) return

31-61: Widget management is clever but could benefit from a brief comment.

The auto-grow/shrink logic via Object.defineProperty is functional but non-obvious. Consider adding a brief inline comment explaining the behavior: new widgets are added when the last option is filled, and empty trailing widgets are removed when the second-to-last becomes empty.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9d5ce7 and 7e0e0d2.

📒 Files selected for processing (3)
  • src/extensions/core/customCombo.ts (1 hunks)
  • src/extensions/core/index.ts (1 hunks)
  • src/stores/nodeDefStore.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
src/**/stores/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/stores/**/*.{ts,tsx}: Maintain clear public interfaces and restrict extension access in stores
Use TypeScript for type safety in state management stores

Files:

  • src/stores/nodeDefStore.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/stores/nodeDefStore.ts
  • src/extensions/core/index.ts
  • src/extensions/core/customCombo.ts
**/stores/*Store.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name Pinia stores with the *Store.ts suffix

Files:

  • src/stores/nodeDefStore.ts
🧬 Code graph analysis (1)
src/extensions/core/customCombo.ts (4)
src/scripts/app.ts (1)
  • app (1708-1708)
src/composables/functional/useChainCallback.ts (1)
  • useChainCallback (24-35)
src/extensions/core/widgetInputs.ts (1)
  • input (353-366)
src/lib/litegraph/src/litegraph.ts (1)
  • LiteGraph (17-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: collect
  • GitHub Check: lint-and-format
🔇 Additional comments (3)
src/stores/nodeDefStore.ts (1)

222-237: LGTM! Node definition looks well-structured.

The CustomCombo definition follows the pattern of other system nodes. Minor observation: the output type uses lowercase 'string' while the input type uses uppercase 'STRING'. Verify this is intentional for LiteGraph compatibility.

src/extensions/core/index.ts (1)

5-5: LGTM!

Import follows the established pattern and alphabetical ordering.

src/extensions/core/customCombo.ts (1)

110-115: LGTM!

Extension registration follows the established pattern with proper naming convention.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e0e0d2 and a9f2c4d.

📒 Files selected for processing (1)
  • src/extensions/core/customCombo.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/extensions/core/customCombo.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/extensions/core/customCombo.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/extensions/core/customCombo.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/extensions/core/customCombo.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/extensions/core/customCombo.ts
🧬 Code graph analysis (1)
src/extensions/core/customCombo.ts (3)
src/extensions/core/widgetInputs.ts (2)
  • applyToGraph (43-87)
  • input (353-366)
src/scripts/app.ts (1)
  • app (1708-1708)
src/composables/functional/useChainCallback.ts (1)
  • useChainCallback (24-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (2)
src/extensions/core/customCombo.ts (2)

1-5: Imports are well-organized.

The imports are properly typed and follow the project's import conventions.


104-113: Extension registration follows best practices.

The extension properly:

  • Uses optional chaining to safely check nodeData?.name
  • Guards against incorrect node types
  • Chains callbacks with useChainCallback to compose behavior
  • Follows the established extension pattern

Comment on lines +7 to +45
function applyToGraph(this: LGraphNode, extraLinks: LLink[] = []) {
if (!this.outputs[0].links?.length || !this.graph) return

const links = [
...this.outputs[0].links.map((l) => this.graph!.links[l]),
...extraLinks
]
let v = this.widgets?.[0].value
// For each output link copy our value over the original widget value
for (const linkInfo of links) {
const node = this.graph?.getNodeById(linkInfo.target_id)
const input = node?.inputs[linkInfo.target_slot]
if (!input) {
console.warn('Unable to resolve node or input for link', linkInfo)
continue
}

const widgetName = input.widget?.name
if (!widgetName) {
console.warn('Invalid widget or widget name', input.widget)
continue
}

const widget = node.widgets?.find((w) => w.name === widgetName)
if (!widget) {
console.warn(`Unable to find widget "${widgetName}" on node [${node.id}]`)
continue
}

widget.value = v
widget.callback?.(
widget.value,
app.canvas,
node,
app.canvas.graph_mouse,
{} as CanvasPointerEvent
)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Extract shared logic to reduce duplication.

This function duplicates significant logic from widgetInputs.ts (lines 42-86). The core link-traversal and widget-update pattern is identical.

Consider extracting the shared logic into a common utility function that both implementations can use, perhaps accepting a value-transformer function to handle the text-replacement difference.

Example approach:

// In a shared utility file
function propagateWidgetValue(
  node: LGraphNode,
  outputIndex: number,
  value: any,
  extraLinks: LLink[] = []
) {
  if (!node.outputs[outputIndex].links?.length || !node.graph) return
  
  const links = [
    ...node.outputs[outputIndex].links.map((l) => node.graph!.links[l]),
    ...extraLinks
  ]
  
  for (const linkInfo of links) {
    const targetNode = node.graph?.getNodeById(linkInfo.target_id)
    const input = targetNode?.inputs[linkInfo.target_slot]
    // ... rest of logic
  }
}
🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around lines 7 to 45 the applyToGraph
implementation duplicates the link-traversal and widget-update logic found in
widgetInputs.ts; extract that shared behavior into a common utility (e.g.,
propagateWidgetValue) placed in a shared utils file, which accepts the node
(this), output index (0), the value to propagate, optional extraLinks, and an
optional value-transformer callback; move the common code that resolves graph
links, finds target node/input/widget, sets widget.value and invokes
widget.callback into that utility, keep all existing null-checks and warning
messages, and replace applyToGraph with a call to the new utility (passing a
transformer that returns v unchanged) and update widgetInputs.ts to call the
same utility with its own transformer for text replacement so both
implementations reuse the single function and preserve typings and behavior.

...this.outputs[0].links.map((l) => this.graph!.links[l]),
...extraLinks
]
let v = this.widgets?.[0].value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Add defensive check for widgets array.

The code assumes this.widgets[0] exists without validation. While the node definition likely ensures this, adding a defensive check improves robustness.

-  let v = this.widgets?.[0].value
+  const widget = this.widgets?.[0]
+  if (!widget) return
+  let v = widget.value
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let v = this.widgets?.[0].value
const widget = this.widgets?.[0]
if (!widget) return
let v = widget.value
🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around line 14, the code accesses
this.widgets[0].value without validating this.widgets or this.widgets[0]; add a
defensive check to ensure this.widgets is an array and has at least one element
before reading .value (e.g., guard with if (!Array.isArray(this.widgets) ||
this.widgets.length === 0) return or set v = undefined), and use the safe v
afterwards so you don't access .value on undefined.

Comment on lines 50 to 58
const comboWidget = this.widgets![0]
Object.defineProperty(comboWidget.options, 'values', {
get: () => {
return this.widgets!.filter(
(w) => w.name.startsWith('option') && w.value
).map((w) => w.value)
}
})
const options = comboWidget.options as { values: string[] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Validate widget existence and type.

The code uses non-null assertions (this.widgets![0]) assuming the combo widget exists and is first. If the node definition changes or widgets aren't initialized, this will throw at runtime.

Add validation:

+  if (!this.widgets || this.widgets.length === 0) {
+    console.error('CustomCombo node missing expected widgets')
+    return
+  }
  const comboWidget = this.widgets![0]
+  // Optionally validate it's actually a combo widget
+  if (comboWidget.type !== 'combo') {
+    console.error('Expected first widget to be combo type')
+    return
+  }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around lines 50 to 58, the code assumes
this.widgets and this.widgets[0] exist and are the combo widget; replace the
non-null assertions with explicit validation: check that this.widgets is an
array and has at least one element, find the combo widget by name/type (e.g.,
first widget whose name === 'combo' or matches expected signature) rather than
assuming index 0, verify the found widget has an options object before defining
the 'values' property, and if validation fails either throw a clear error or
return a safe fallback (empty options/values) so the code never dereferences
undefined.

function updateCombo() {
if (app.configuringGraph) return
const { values } = options
if (values.includes(`${comboWidget.value}`)) return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Clarify string coercion intent.

The comparison uses string template coercion ${comboWidget.value} rather than direct comparison. This might be intentional to handle type flexibility, but it's unclear.

If intentional, consider adding a comment:

-    if (values.includes(`${comboWidget.value}`)) return
+    // Coerce to string to handle mixed types
+    if (values.includes(`${comboWidget.value}`)) return

Or use explicit conversion for clarity:

-    if (values.includes(`${comboWidget.value}`)) return
+    if (values.includes(String(comboWidget.value))) return
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (values.includes(`${comboWidget.value}`)) return
if (values.includes(String(comboWidget.value))) return
🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around line 63, the check uses template
string coercion if (values.includes(`${comboWidget.value}`)) which is unclear;
replace the template string with an explicit conversion (e.g.,
String(comboWidget.value)) so intent is obvious, or if the template coercion was
intentional add a one-line comment explaining why coercion via string is
required (type(s) expected and why) so future readers understand the comparison.

node.widgets
.findLast((w) => w.name.startsWith('option'))
?.name?.slice(6) || '-1'
const newCount = parseInt(widgetPostfix) + 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Specify radix in parseInt.

The parseInt call should include a radix parameter to avoid potential parsing issues.

-    const newCount = parseInt(widgetPostfix) + 1
+    const newCount = parseInt(widgetPostfix, 10) + 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const newCount = parseInt(widgetPostfix) + 1
const newCount = parseInt(widgetPostfix, 10) + 1
🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around line 76, the parseInt call lacks a
radix; update the call to include the radix (e.g., parseInt(widgetPostfix, 10))
so the string is parsed as a base-10 integer, and if desired add a quick NaN
check after parsing to handle unexpected input.

Comment on lines 82 to 99
Object.defineProperty(widget, 'value', {
get() {
return value
},
set(v) {
value = v
updateCombo()
if (!node.widgets) return
const lastWidget = node.widgets.at(-1)
if (lastWidget === this) {
if (v) addOption(node)
return
}
if (v || node.widgets.at(-2) !== this || lastWidget?.value) return
node.widgets.pop()
node.computeSize(node.size)
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider simplifying the custom value setter logic.

The custom getter/setter has complex side effects including:

  • Calling updateCombo() on every value change
  • Auto-adding new widgets when the last one is filled
  • Auto-removing widgets with complex conditions
  • Mutating the node.widgets array during property access

This complexity makes the behavior harder to reason about and test. Consider:

  1. Extracting the auto-add/remove logic into separate, well-named functions
  2. Adding comments explaining the removal condition (line 95)
  3. Ensuring widget array mutations are safe if iteration is happening elsewhere

Example structure:

function shouldAutoAddOption(widget, value, node) {
  return node.widgets.at(-1) === widget && value
}

function shouldAutoRemoveOption(widget, value, node) {
  const lastWidget = node.widgets.at(-1)
  const secondToLast = node.widgets.at(-2)
  // Remove this widget if:
  // - It has no value
  // - AND it's second-to-last
  // - AND the last widget also has no value
  return !value && secondToLast === widget && !lastWidget?.value
}

set(v) {
  value = v
  updateCombo()
  if (!node.widgets) return
  
  if (shouldAutoAddOption(this, v, node)) {
    addOption(node)
  } else if (shouldAutoRemoveOption(this, v, node)) {
    node.widgets.pop()
    node.computeSize(node.size)
  }
}
🤖 Prompt for AI Agents
In src/extensions/core/customCombo.ts around lines 82 to 99, the custom setter
for widget.value mixes multiple side-effects (updateCombo, auto-add,
auto-remove) and mutates node.widgets inline, making behavior hard to reason
about and unsafe during iteration; refactor by extracting the auto-add and
auto-remove checks into two well-named helper functions (e.g.,
shouldAutoAddOption(widget, value, node) and shouldAutoRemoveOption(widget,
value, node)), replace the inline conditionals with calls to those helpers, add
a concise comment explaining the removal condition (why we remove the
second-to-last empty widget when the last is also empty), and make the mutation
of node.widgets safe (use the widget index to remove via splice or defer
mutation to a safe tick/event instead of mutating during property access).

@DrJKL
Copy link
Contributor

DrJKL commented Dec 4, 2025

I think this doesn't work when using Nodes 2.0

@AustinMroz
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants